@reference "../../styles/index.css";

.articleLayout {
  @apply max-w-8xl
    mx-auto
    block
    w-full
    sm:grid
    sm:grid-cols-[theme(spacing.52)_1fr]
    sm:grid-rows-[1fr]
    sm:overflow-visible
    sm:[grid-template-areas:'sidebar_main''sidebar_footer']
    md:grid-cols-[theme(spacing.64)_1fr]
    lg:grid-cols-[theme(spacing.52)_1fr_theme(spacing.52)]
    lg:[grid-template-areas:'sidebar_main_metabar''sidebar_footer_metabar']
    xl:grid-cols-[theme(spacing.80)_1fr_theme(spacing.80)];

  > *:nth-child(1) {
    @apply [grid-area:sidebar]
      lg:sticky
      lg:top-0
      lg:h-[100vh]
      lg:overflow-y-auto;
  }

  > *:nth-child(2) {
    @apply contents
      sm:max-lg:block;

    > *:first-child {
      @apply sm:bg-gradient-subtle
        sm:dark:bg-gradient-subtle-dark
        p-4
        [grid-area:main]
        motion-safe:scroll-smooth
        sm:bg-fixed
        sm:p-12
        xl:px-18;
    }

    > *:last-child {
      @apply mt-8
        border-t
        [grid-area:metabar]
        sm:mt-0
        lg:sticky
        lg:top-0
        lg:max-w-xs
        lg:border-t-0
        lg:border-l;
    }
  }

  > *:nth-child(3) {
    @apply sticky
      bottom-0
      flex
      w-full
      flex-col
      items-center
      self-stretch
      border-t
      border-t-neutral-200
      bg-white
      py-4
      [grid-area:footer]
      dark:border-t-neutral-900
      dark:bg-neutral-950;
  }
}
